package models

import (
	"github.com/guregu/null"
	"gorm.io/gorm"
)

type Role struct {
	gorm.Model
	Id        int    `gorm:"column:id" json:"id"`
	RoleName  string `gorm:"column:role_name" json:"roleName"`
	RoleKey   string `gorm:"column:role_key" json:"roleKey"`
	Status    int    `gorm:"column:status" json:"status"`
	OrderNum  int    `gorm:"column:order_num" json:"orderNum"`
	Remark    string `gorm:"column:remark" json:"remark"`
	IsDeleted int    `gorm:"column:is_deleted" json:"isDeleted"`
}
type RoleAllVo struct {
	gorm.Model
	Id         int    `gorm:"column:id" json:"id"`
	RoleName   string `gorm:"column:role_name" json:"roleName"`
	RoleKey    string `gorm:"column:role_key" json:"roleKey"`
	Status     int    `gorm:"column:status" json:"status"`
	OrderNum   int    `gorm:"column:order_num" json:"orderNum"`
	CreateTime MyTime `gorm:"column:created_at" json:"createTime"`
}
type RoleDto struct {
	gorm.Model
	Id       int    `gorm:"column:id" json:"id"`
	RoleName string `gorm:"column:role_name" json:"roleName"`
	RoleKey  string `gorm:"column:role_key" json:"roleKey"`
	Status   int    `gorm:"column:status" json:"status"`
	OrderNum int    `gorm:"column:order_num" json:"orderNum"`
	Remark   string `gorm:"column:remark" json:"remark"`
	MenuIds  []int  `gorm:"-" json:"menuIds"`
}
type RoleByIdVo struct {
	gorm.Model
	Id       int    `gorm:"column:id" json:"id"`
	RoleName string `gorm:"column:role_name" json:"roleName"`
	RoleKey  string `gorm:"column:role_key" json:"roleKey"`
	Status   int    `gorm:"column:status" json:"status"`
	OrderNum int    `gorm:"column:order_num" json:"orderNum"`
	Remark   string `gorm:"column:remark" json:"remark"`
	MenuIds  []int  `gorm:"-" json:"menuIds"`
}
type UpdateRoleStatusDto struct {
	Id     int `json:"id"`
	Status int `json:"status"`
}
type RoleSearchDto struct {
	gorm.Model
	RoleName        string   `gorm:"column:role_name" json:"roleName"`
	RoleKey         string   `gorm:"column:role_key" json:"roleKey"`
	Status          null.Int `gorm:"column:status" json:"status"`
	CreateTimeStart MyTime   `gorm:"-" json:"createTimeStart"`
	CreateTimeEnd   MyTime   `gorm:"-" json:"createTimeEnd"`
}
type RoleDeleteDto struct {
	Ids []int `json:"ids"`
}
type RoleVo struct {
	gorm.Model
	Id       int    `gorm:"column:id" json:"id"`
	RoleName string `gorm:"column:role_name" json:"roleName"`
}

func (RoleVo) TableName() string {
	return "sys_role"
}
func (RoleAllVo) TableName() string {
	return "sys_role"
}
func (RoleByIdVo) TableName() string {
	return "sys_role"
}
func (RoleDto) TableName() string {
	return "sys_role"
}
func (RoleSearchDto) TableName() string {
	return "sys_role"
}

func (Role) TableName() string {
	return "sys_role"
}
